class SweetPotato:
    def __init__(self):
        self.cook_time = 0
        self.cook_state = '生的'

    def cook(self, time):
        self.cook_time += time
        if 0 <= self.cook_time < 3:
            self.cook_state = '生的'
        elif 3 <= self.cook_time < 8:
            self.cook_state = '熟的'
        elif self.cook_time >= 8:
            self.cook_state = '糊了'

    def __str__(self):
        return f'考了{self.cook_time}分钟,现在是{self.cook_state}'

sweet = SweetPotato()
sweet.cook(5)
print(sweet)